%option c++
%option noyywrap

%{
#include <cstdio>
#include <iostream>
using namespace std;
//#define YY_DECL extern "C" int yylex()

int line_no = 1; // liczba linii

//#include "ASMparser2.tab.h"  // to get the token types that we return

%}
%%
[a-zA-Z0-9]+:			{ yylval = (yytext); return ETYKIETA; }
[0-9]+\.[0-9]+ 			{ yylval = (yytext); return FLOAT; }
[0-9]+            		{ yylval = (yytext); return INT; }
"true"|"false"			{ yylval = (yytext); return BOOL; }
\"[a-zA-Z0-9 ]+\"  		{ yylval = (yytext); return STRING; }							

int						{ yylval = (yytext); return TYP_INT; }
float 					{ yylval = (yytext); return TYP_FLOAT; }
bool 					{ yylval = (yytext); return TYP_BOOL; }
string					{ yylval = (yytext); return TYP_STRING; }

push					{ yylval = (yytext); return PUSH; }
set						{ yylval = (yytext);return SET; }

add						{ yylval = (yytext);return ADD; }
subs					{ yylval = (yytext);return SUBS; }
multi					{ yylval = (yytext);return MULTI; }
div						{ yylval = (yytext);return DIV; }

retval					{ yylval = (yytext);return RETVAL; }
jmpif					{ yylval = (yytext);return JMPIF; }

eql						{ yylval = (yytext);return EQL; }
neql					{ yylval = (yytext);return NEQL; }
cmp						{ yylval = (yytext);return CMP; }
leql					{ yylval = (yytext);return LEQL; }
geql					{ yylval = (yytext);return GEQL; }

print					{ yylval = (yytext);return PRINT; }
","						{ yylval = (yytext);return PRZECINEK; }
";"						{ yylval = (yytext);return END_OF_LINE; }
[a-zA-Z]([a-zA-Z0-9])*	{ yylval = (yytext); return ID_ZMIENNEJ; }
\n     					{ line_no++; /* printf("++ line:  %d\n", line_no); */}
[ \t\f]           	;
.                	;
%%